package 力扣日常刷题.木22二月.第01天206;

/**
 * @author 帅小伙
 * @date 2022/2/6
 * @description
 */
public class Demo13JZ斐波那契数列 {


    public int fib(int n) {
        if (n < 2) return n;
        final int MOD = 1000000007;
        int a = 0, b = 1;
        for (int i = 2; i <= 2; i++) {
            int t = b;
            b = (a + b) % MOD;
            a = t % MOD;
        }
        return b;
    }
}
